README for "The Self-Constrained Hand-to-Mouth" by Michael Gelman
01/20/21

Note on source data: This paper makes use of individual-level account data from a financial services app. I will not be able to post source data since it contains individual-level transactions and balance information that cannot be released to protect privacy and confidentiality. Accordingly, this paper has received an exemption from the data posting policy.

File structure

run_all.sh - Unix shell script that will execute all of the code
SelfConstrained.do - Stata file which generates tables and figures from the source data
SelfConstrained.log - Stata log output
SQL_data_load.ado - Stata ado file that contain functions related to querying and processing source data from mysql database
simulate_model_standard.m - Matlab file which generates tables and figures from the theoretical model
simulate_model_hyperbolic.m - Matlab file which generates tables and figures from the theoretical model
tauchen.m - Matlab file used for discretizing the shock distribution
food_predict.py - Python file used to predict food spending

Data dictionary

user_id - unique individual id
week_date - week identifier 
year - year identifier  
freq - paycheck frequency 
odd_week - odd paycheck schedule dummy
pay_week - pay week dummy
log_x_food - log food expeditures
diff_log_x_food - log food expenditures growth 
liq_xtile - average liquidity tercile
log_liq - log liquid balance
log_liq_pay - log liquidity during the pay week
log_liq_res_pay - relative liquidity for the pay week
log_liq_nopay - log liquidity during the non pay week
log_liq_res_nopay - relative liquidity for the non pay week
refund_week - dummy for tax refund received during that week
prev_refund_week - dummy for tax reufund received during the previous week
log_liq_pay_ref2 - interaction of log liquidity during the pay week and refund received in the prev week
log_liq_nopay_ref2 - interaction of log liquidity during the non pay week and refund received in the prev week